<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        function Throllte(fn,delay)
        {
             let startTime = 0;
             return function(...args)
             {
                let nowTime = Date.now();
                if(startTime+delay<nowTime)
                {
                     fn(...args);
                     startTime = nowTime;
                }
             }
        }

        function fn()
        {
             console.log('我是节流函数');
        }

        window.addEventListener('click',Throllte(fn,3000));
    </script>
</body>
</html>